package app.modules.menu.util.conversion;

import app.modules.common.annotation.ConvertFrom;
import app.modules.common.annotation.ConvertTo;
import app.modules.menu.dto.web.template.WebMenuTemplateDTO;
import jasmine.framework.common.util.MapperUtil;
import jasmine.security.rbac.model.SecMenuTemplate;

/**
 * @author mh.z
 */
public class MenuTemplateConvertUtil {

    @ConvertFrom(SecMenuTemplate.class)
    @ConvertTo(WebMenuTemplateDTO.class)
    public static WebMenuTemplateDTO secMenuTemplate2WebMenuTemplateDTO(SecMenuTemplate secMenuTemplate) {
        if (secMenuTemplate == null) {
            return null;
        }

        return MapperUtil.mapTo(secMenuTemplate, WebMenuTemplateDTO.class);
    }

}
